FNP - Data Structures - LSEQ CRDT Identifiers
Summary (Explain Like I’m 5)
Imagine you and 100 colleagues editing a document at the same exact moment, all inserting at position 0. What’s the order? LSEQ solves this by giving every character a unique ID that’s created locally before the server sees it:- You insert “H” → ID = [500, from_you, timestamp]
- Colleague inserts “e” → ID = [501, from_them, timestamp]
- Both created simultaneously but deterministically ordered: 500 < 501
Technical Deep Dive
LSEQ (LogootSplit) is a Conflict-free Replicated Data Type using variable-length position identifiers to maintain deterministic document order without coordination. Identifier Structure:- Enc_id_1 < Enc_id_2 ⟺ id_1 < id_2 (order preserved in ciphertext domain)
Mermaid Diagrams
Key Terms
- LSEQ → LogootSplit; CRDT using variable-length identifiers
- CRDT → Conflict-free Replicated Data Type; commutative, associative, idempotent merge
- Lexicographic Order → Dictionary order; compare element-by-element left-to-right
- Depth Doubling → When gap between consecutive digits exhausted, recurse to next level
- Site ID → Unique replica identifier; breaks ties when digits and counters match
- Lamport Clock → Monotonic counter incremented on each local operation; breaks duplicate (digit, site)
- Concurrent Conflicts → Multiple simultaneous edits; LSEQ provides deterministic resolution
- Position Stability → Character position never changes; enables efficient caching and offline editing
Q/A
Q: How do 100 people editing simultaneously at position 0 not create chaos? A: Each person generates their own unique ID locally based on their replica ID and Lamport clock. Position 0 becomes many unique IDs (500, 501, 502, …) that are deterministically ordered. Server merges by comparing encrypted identifiers using M²-ORE. Q: What prevents ID explosion? Don’t IDs get really long? A: IDs grow as O(log N) depth for N insertions. Even after 1 million insertions, average depth is only ~20 tuples. Most characters have 1-3 tuples. Typical LSEQ identifier: [⟨500, site=1, counter=5⟩, ⟨250, site=2, counter=3⟩] - only 2 levels deep. Q: Why include site_id and counter if digit uniquely identifies position? A: Multiple replicas might generate identical digits simultaneously. Example: Alice generates digit=500 at replica 1, Bob generates digit=500 at replica 2. Tiebreaker: compare (site_id, counter). Alice_site < Bob_site → Alice’s insertion comes first. Q: How are IDs encrypted while preserving ordering? A: Each digit is independently encrypted with M²-ORE, creating an encrypted identifier. The critical property: if digit₁ < digit₂, then Enc(digit₁) < Enc(digit₂) in the encrypted domain. Server compares encrypted identifiers directly. Q: What happens if someone tries to reorder identifiers by tampering with site_id or counter? A: LSEQ identifiers are deterministically generated and immutable. Tampering is detected as invalid operations. Halo2 proofs verify that the identifier was correctly generated; invalid IDs are rejected by the server.Example / Analogy
Library Shelf Analogy: You and friends are organizing a shared library remotely:- Without LSEQ: “Put book at position 5” - if everyone puts books at position 5 simultaneously, conflict!
- With LSEQ: Each book gets a unique barcode at the moment you decide to shelve it:
- Your book: barcode 500.001 (your ID is 001)
- Friend’s book: barcode 500.002 (their ID is 002)
- Both meant to go at “position 5” but get unique, ordered barcodes
- Shelf auto-sorts by barcode: both books end up in right order with no conflict
- Each writes locally with M²-ORE encryption
- LSEQ gives each character a unique ID created before sending to server
- Your characters: [⟨[500…], site=1, clk=1⟩, ⟨[501…], site=1, clk=2⟩, …]
- Colleague 2’s characters: [⟨[500…], site=2, clk=1⟩, …]
- Server merges deterministically using M²-ORE comparison
- Everyone sees identical order - no conflicts, no “who goes first?”
Cross-References: System Overview, M²-ORE Encryption, FNP Protocol Flow, Halo2 Circuits Category: Data Structures | Consensus | CRDT | Protocol Difficulty: Intermediate ⭐⭐⭐ Updated: 2025-11-28